<template>
	<div ref="content" class="content" :class="{'has-header':hasHeader}">
		<div>
			<slot></slot>
		</div>
	</div>
</template>

<script>
	export default {
		name: "com-content",
		props: {
			hasHeader: Boolean
		},
		mounted(){
			//滚动效果
			let myScroll = new IScroll(this.$refs.content,{
				mouseWheel: true,
			    scrollbars: true,
			    fadeScrollbars: true,
			    bounce: false,
			    probeType: 3
			})
			//监听scroll事件，传入myScroll.y的值
			myScroll.on("scroll",()=>{
				this.center.$emit("show-search",myScroll.y)
			})
		}
	}
</script>

<style>
	.content{
		position: absolute;
		width: 100%;
		top: 0;
		left: 0;
		bottom: 13.07vw;
		overflow: hidden;
	}
	.content.has-header{
		top: 11.73vw;
	}
</style>